import Vue from 'vue'

const axios = Vue.$axios

export const GetListDict = () => {
    return axios({
            url: '/dicts',
            method: 'get',
        })
}

export const GetOneDict = (id) => {
    return axios({
        url: '/dicts/' + id,
        method: 'get'
    })
}

export const CreateOneDict = (data) => {
    return axios({
        url: '/dicts',
        method: 'post',
        data: data
    })
}

export const UpdateOneDict = (data) => {
    return axios({
        url: '/dicts' + '/' + data.id,
        method: 'put',
        data: data
    })
}

export const PatchOneDict = (data) => {
    return axios({
        url: '/dicts' + "/" + data.id,
        method: 'patch',
        data: data
    })
}

export const RemoveOneDict = (id) => {
    return axios({
        url: '/dicts/' + id,
        method: 'delete',
    })
}